package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 市场参考价格表
 * @TableName market_reference_price
 */
@TableName(value ="market_reference_price")
@Data
public class MarketReferencePrice implements Serializable {
    /**
     * 参考价格ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 品牌ID
     */
    private Long brandId;

    /**
     * 型号ID
     */
    private Long modelId;

    /**
     * 年份
     */
    private Integer year;

    /**
     * 里程范围最小值(万公里)
     */
    private BigDecimal mileageRangeMin;

    /**
     * 里程范围最大值(万公里)
     */
    private BigDecimal mileageRangeMax;

    /**
     * 车况评分
     */
    private BigDecimal conditionRating;

    /**
     * 参考价格(万元)
     */
    private BigDecimal referencePrice;

    /**
     * 价格范围最小值
     */
    private BigDecimal priceRangeMin;

    /**
     * 价格范围最大值
     */
    private BigDecimal priceRangeMax;

    /**
     * 数据来源
     */
    private String dataSource;

    /**
     * 更新频率
     */
    private String updateFrequency;

    /**
     * 最后更新时间
     */
    private Date lastUpdateTime;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MarketReferencePrice other = (MarketReferencePrice) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
            && (this.getModelId() == null ? other.getModelId() == null : this.getModelId().equals(other.getModelId()))
            && (this.getYear() == null ? other.getYear() == null : this.getYear().equals(other.getYear()))
            && (this.getMileageRangeMin() == null ? other.getMileageRangeMin() == null : this.getMileageRangeMin().equals(other.getMileageRangeMin()))
            && (this.getMileageRangeMax() == null ? other.getMileageRangeMax() == null : this.getMileageRangeMax().equals(other.getMileageRangeMax()))
            && (this.getConditionRating() == null ? other.getConditionRating() == null : this.getConditionRating().equals(other.getConditionRating()))
            && (this.getReferencePrice() == null ? other.getReferencePrice() == null : this.getReferencePrice().equals(other.getReferencePrice()))
            && (this.getPriceRangeMin() == null ? other.getPriceRangeMin() == null : this.getPriceRangeMin().equals(other.getPriceRangeMin()))
            && (this.getPriceRangeMax() == null ? other.getPriceRangeMax() == null : this.getPriceRangeMax().equals(other.getPriceRangeMax()))
            && (this.getDataSource() == null ? other.getDataSource() == null : this.getDataSource().equals(other.getDataSource()))
            && (this.getUpdateFrequency() == null ? other.getUpdateFrequency() == null : this.getUpdateFrequency().equals(other.getUpdateFrequency()))
            && (this.getLastUpdateTime() == null ? other.getLastUpdateTime() == null : this.getLastUpdateTime().equals(other.getLastUpdateTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        result = prime * result + ((getModelId() == null) ? 0 : getModelId().hashCode());
        result = prime * result + ((getYear() == null) ? 0 : getYear().hashCode());
        result = prime * result + ((getMileageRangeMin() == null) ? 0 : getMileageRangeMin().hashCode());
        result = prime * result + ((getMileageRangeMax() == null) ? 0 : getMileageRangeMax().hashCode());
        result = prime * result + ((getConditionRating() == null) ? 0 : getConditionRating().hashCode());
        result = prime * result + ((getReferencePrice() == null) ? 0 : getReferencePrice().hashCode());
        result = prime * result + ((getPriceRangeMin() == null) ? 0 : getPriceRangeMin().hashCode());
        result = prime * result + ((getPriceRangeMax() == null) ? 0 : getPriceRangeMax().hashCode());
        result = prime * result + ((getDataSource() == null) ? 0 : getDataSource().hashCode());
        result = prime * result + ((getUpdateFrequency() == null) ? 0 : getUpdateFrequency().hashCode());
        result = prime * result + ((getLastUpdateTime() == null) ? 0 : getLastUpdateTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", brandId=").append(brandId);
        sb.append(", modelId=").append(modelId);
        sb.append(", year=").append(year);
        sb.append(", mileageRangeMin=").append(mileageRangeMin);
        sb.append(", mileageRangeMax=").append(mileageRangeMax);
        sb.append(", conditionRating=").append(conditionRating);
        sb.append(", referencePrice=").append(referencePrice);
        sb.append(", priceRangeMin=").append(priceRangeMin);
        sb.append(", priceRangeMax=").append(priceRangeMax);
        sb.append(", dataSource=").append(dataSource);
        sb.append(", updateFrequency=").append(updateFrequency);
        sb.append(", lastUpdateTime=").append(lastUpdateTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}